//TODO: Pozmieniac zawartos ponizszych metod. Teraz jest skopiowane z SearchTemplate
var EntryTemplate = function() {
	var _entryTemplate = null;
	var _commentTemplate = null;
	
	var getEntryTemplate = function() {
		if(!_entryTemplate) {
			$.ajax({
				url: "templates/entry.html",
				success: function(html) {
					_entryTemplate = $(html);
				},
				async: false
			});
		}
		
		return _entryTemplate.clone();
	};
	
	var getShortEntryTemplate = function() {
		var $template = $( "<li/>", {});
		var $container = $( "<a/>", { class: "search_text" });
		
		$template.append($container);
		
		return $template;
	};
	
	var getCommentTemplate = function() {
		if(!_commentTemplate) {
			$.ajax({
				url: "templates/comment_.html",
				success: function(html) {
					_commentTemplate = $(html);
				},
				async: false
			});
		}
		
		return _commentTemplate.clone();
	};
	
	return {
		normal: getEntryTemplate,
		short: getShortEntryTemplate,
		comment: getCommentTemplate
	};
}();